<template>
  <div>
    hello info component
    <button type="button" @click="add()">添加</button>
  </div>
</template>

<script>
  <!--在界面中使用 vuex,@符号代表src目录-->
import store from '@/store'
export default {
  name: 'Info',
  //引入store
  store,
  methods: {
    add () {
      console.log('add Event from info!')
      //使用store.commit 引用 store里面方法的名字
      store.commit('increase')
    }
  }
}
</script>

<style scoped>

</style>
